<div class="col-lg-12">

	<div class="portlet">
    <div class="portlet-title">
        <div class="caption">
            <i class="fa fa-plus"></i><?= isset($this->data[$als]) ? 'Sửa' : 'Thêm mới'; ?>
        </div>
    </div>


	<div class="portlet-body form">
		<?php echo $this->Form->create($als, array('class' => 'form-horizontal form-bordered', 'type' => 'file'));?>
		<div class="portlet-body">
			<div class="form-body">
				<div class="form-group">
					<label class="col-sm-3 control-label">Mã 1</label>
					<div class="col-sm-5">
						<?php echo $this->Form->hidden($als.'.id' )?>
						<?php echo $this->Form->input($als.'.code1', array( 'label' => false, 'div' => false, 'class' => 'form-control', 'readonly' => $global_user['role'] != 9, 'placeholder' => 'COM' ) )?>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">Mã 2</label>
					<div class="col-sm-5">
						<?php echo $this->Form->input($als.'.code2', array( 'label' => false, 'div' => false, 'class' => 'form-control', 'readonly' => $global_user['role'] != 9, 'placeholder' => 'STS' ) )?>
					</div>
				</div>

				<div class="form-group">
					<label class="col-sm-3 control-label">Tên</label>
					<div class="col-sm-5">
						<?php echo $this->Form->input($als.'.name', array( 'label' => false, 'div' => false, 'class' => 'form-control', 'readonly' => $global_user['role'] != 9, 'placeholder' => 'Nhập tên' ) )?>
					</div>
				</div>

				<div class="form-group">
					<label class="col-sm-3 control-label">Giá trị</label>
					<div class="col-sm-5">
						<?php echo $this->Form->input($als.'.value', array( 'label' => false, 'div' => false, 'class' => 'form-control', 'placeholder' => 'Nhập giá trị' ) )?>
					</div>
				</div>

				<?php if($global_user['role'] == 9):?>
				<div class="form-group">
					<label class="col-sm-3 control-label">Thứ tự</label>
					<div class="col-sm-5">
						<?php echo $this->Form->input($als.'.sort', array( 'label' => false, 'div' => false, 'class' => 'form-control', 'placeholder' => 'Nhập thứ tự' ) )?>
					</div>
				</div>
				<?php endif; ?>

				<?php if($global_user['role'] == 9):?>
				<div class="form-group">
					<label class="col-sm-3 control-label">Hệ thống</label>
					<div class="col-sm-5">
						<div class="radio-list">
							<label class="radio-inline">
								<input type="radio" name="data[Codetbl][sys]" id="CodetblSys" value="1" <?= isset($this->data[$als]['sys']) && $this->data[$als]['sys'] == 1 ? 'checked="checked"' : '' ?> />
								<?= __('Có')?>
							</label>
							<label class="radio-inline">
								<input type="radio" name="data[Codetbl][sys]" id="CodetblSys" value="0" <?= !isset($this->data[$als]['sys']) || (isset($this->data[$als]['sys']) && $this->data[$als]['sys'] == 0) ? 'checked="checked"' : '' ?>/>
								<?= __('Không')?>
							</label>
						</div>
					</div>
				</div>


				<div class="form-group">
					<label class="col-sm-3 control-label">Miêu tả</label>
					<div class="col-sm-5">
						<?php echo $this->Form->textarea($als.'.desc', array( 'label' => false, 'div' => false, 'class' => 'form-control', 'placeholder' => 'Nhập nội dung miêu tả' ) )?>
					</div>
				</div>
				<?php endif; ?>

			</div>
			<div class="form-actions fluid">
				<div class="col-md-offset-3 col-md-9">
					<button type="submit" class="btn btn-success"><?= __('Lưu') ?></button>
					<a href="<?= $this->webroot.'admin/codetbls' ?>" class="btn btn-default">Hủy bỏ</a>
				</div>
			</div>
		</div>
		<?php echo $this->Form->end( ); ?>
	</div><!-- End protet -->

</div>
